package com.java.dao;

import java.sql.Connection;
import java.util.ArrayList;

import com.java.db.*;
import com.java.util.DaoUtils;

public class MidCateSelectDao {
	private static MidCateSelectDao instance;
	private static Connection con = null;
	private static ArrayList al = null;

	private MidCateSelectDao() {

	}

	public static MidCateSelectDao getInstance() {
		if (instance == null) {
			instance = new MidCateSelectDao();
		}
		return instance;

	}

	public static ArrayList getMidCateList(String large_cate) {
		try {
			DaoUtils userdao = new DaoUtils();
			con = (new CommonConnect()).getConnection_ds1();
			
			String queryStr = "call edu_edu0203MidComboList(?)";

			String param[] = new String[1];
			param[0] = large_cate;
			
			al = userdao.select(con, queryStr, param);
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			try {
				if (con != null)
					con.setAutoCommit(true);
				if (con != null)
					con.close();
			} catch (Exception ee) {
				ee.printStackTrace();
			}
		}
		return al;
	}

}
